feat(resolver): add versionmap-git source resolver#1197
Conversation
|
Warning Review limit reached
Next review available in: 38 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughA new Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
docs/reference/config-reference.rst (1)
44-45: ⚡ Quick winAdd a
versionaddeddirective for this new user-facing resolver entry.Line 44 introduces a new config model in user-facing docs, but there’s no explicit version marker in this section. Please add
.. versionadded::next to this entry for release traceability.Suggested patch
.. autopydantic_model:: VersionMapGitResolver + + .. versionadded:: 0.79.0As per coding guidelines: "Use Sphinx
versionadded,versionremoved,versionchangeddirectives for user-facing changes".🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/reference/config-reference.rst` around lines 44 - 45, The VersionMapGitResolver autopydantic_model directive in the config reference documentation is missing a versionadded directive to track when this new user-facing resolver was introduced. Add a `.. versionadded::` directive before the `.. autopydantic_model:: VersionMapGitResolver` line, specifying the appropriate version number where this resolver was first available, to comply with the documentation guidelines for user-facing changes.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/fromager/packagesettings/_resolver.py`:
- Around line 517-522: The validate_clone_url method in the Resolver class
currently accepts URLs with only a host and no repository path because Pydantic
v2 normalizes the path to "/" which is truthy. Add an additional validation
check after the existing path validation to explicitly reject URLs where the
path is only "/" or is root-only. This will prevent invalid git URLs that lack
an actual repository path from passing validation.
---
Nitpick comments:
In `@docs/reference/config-reference.rst`:
- Around line 44-45: The VersionMapGitResolver autopydantic_model directive in
the config reference documentation is missing a versionadded directive to track
when this new user-facing resolver was introduced. Add a `.. versionadded::`
directive before the `.. autopydantic_model:: VersionMapGitResolver` line,
specifying the appropriate version number where this resolver was first
available, to comply with the documentation guidelines for user-facing changes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 48b234c8-c0ab-46c3-a2e3-b4b237852236
📒 Files selected for processing (5)
docs/reference/config-reference.rstsrc/fromager/packagesettings/__init__.pysrc/fromager/packagesettings/_resolver.pytests/test_packagesettings_resolver.pytests/test_resolver.py
5ad9e22 to
6a33ca3
Compare
rd4398
left a comment
There was a problem hiding this comment.
I have left a few comments. Also, please use the linked issue on GitHub as "closes". We should not mention anything related to downstream (AIPCC in this case).
Also, I would appreciate if @tiran and / or @LalatenduMohanty takes a look as well.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/test_packagesettings_resolver.py`:
- Around line 449-455: The current resolver test only verifies git URL rewriting
in resolver_provider and does not cover the new build_sdist contract. Update the
test coverage around resolver_provider and the build path so a versionmap-git
config with build_sdist: tarball is exercised end-to-end, then assert that the
selected sdist strategy comes from sources.build_sdist rather than only checking
VersionMapProvider.version_map. Use the existing resolver_provider, WorkContext,
and sources.build_sdist symbols to locate the behavior and make sure the
regression test fails if build_sdist is ignored downstream.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 3ffdc863-d735-4be6-8304-fbc175a59b48
📒 Files selected for processing (5)
docs/reference/config-reference.rstsrc/fromager/packagesettings/__init__.pysrc/fromager/packagesettings/_resolver.pytests/test_packagesettings_resolver.pytests/test_resolver.py
✅ Files skipped from review due to trivial changes (1)
- docs/reference/config-reference.rst
🚧 Files skipped from review as they are similar to previous changes (3)
- src/fromager/packagesettings/init.py
- src/fromager/packagesettings/_resolver.py
- tests/test_resolver.py
Add `VersionMapGitResolver` config model for the `versionmap-git` provider from the new-resolver-config proposal. Maps version numbers to git refs (commit SHAs or ref paths) with a separate `clone_url`, replacing the need for handwritten Python plugins. - Add `VersionMapGitResolver` pydantic model with `clone_url`, `build_sdist`, and `versionmap` fields - Register in `SourceResolver` discriminated union - Add to config reference docs - Add tests for config parsing, provider output, and validation Closes: python-wheel-build#1180 Co-Authored-By: Claude <claude@anthropic.com> Signed-off-by: Josef Skladanka <jskladan@redhat.com>
|
@rd4398 everything should be addressed. I'm also not sure what to do about the fialing coverage report though. I ran hatch run test:coverage erase
hatch run test:test --cov --cov-report=term-missing --cov-config=pyproject.toml -x -qon both my branch and the current main, and the branch adds 70 statements and 4 branches (new code in the resolver), while actually reducing misses by 1. Coverage is identical at 86% on both branches.
I don't see any coverage regression on my part, but I obviously don't have all the e3e data the CI coverage job combines for the |
Add
VersionMapGitResolverconfig model for theversionmap-gitprovider from the new-resolver-config proposal. Maps version numbers to git refs (commit SHAs or ref paths) with a separateclone_url, replacing the need for handwritten Python plugins.VersionMapGitResolverpydantic model withclone_url,build_sdist, andversionmapfieldsSourceResolverdiscriminated unionCloses: #1180